package com.smartstate.ems.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smartstate.ems.dto.PageDTO;
import com.smartstate.ems.dto.UserDTO;
import com.smartstate.ems.entity.PasswordEntity;
import com.smartstate.ems.entity.Permission;
import com.smartstate.ems.entity.User;
import com.smartstate.ems.entity.UserVo;
import com.smartstate.ems.vo.ResultCode;
import com.smartstate.ems.vo.ResultVO;
import com.smartstate.ems.vo.UserVO;

import java.util.List;

public interface UserService extends ServiceBase<User> {

  List<UserVO<User>> getAllUserAndDepartment(UserDTO<User> item);

  String getSerialCode(String name);

  Boolean setRedisValue(String value) ;

  List<UserVO<User>> findAll();

  Boolean addUser(UserDTO<User> userDTO);

  ResultVO<Boolean> removeByIds(List<String> item);

  Boolean removeById(String id);

  UserVO getById(String id);

  Page<List<UserVO>>  queryAllPageByUserDTO(PageDTO<User> pageDTO);

  ResultVO<User> addNewUser(String roleId, User user);


  ResultVO<Boolean> updateUserById(String roleId,User user);

  ResultVO<Boolean> delUserById(String id);

  Page<User> getUserByNameAndStatus(PageDTO<User> pageDTO);

  ResultVO<List<User>> getList();

  ResultVO<Boolean> updateStatusById(String id,String state);

  UserVo loginByPassword(String username, String password, String code, String randomStr);

  ResultVO<User> getUserByToken();

  ResultVO<List<Permission>> getPermsByToken();

  ResultVO<ResultCode> updatePassword(PasswordEntity ps);

  boolean  initAdmin(String roleId,User user);

}
